package com.kingdee.eas.xbwebservice.client;

import java.sql.SQLException;

import com.kingdee.bos.BOSException;
import com.kingdee.eas.common.EASBizException;
/**
 * @author lifetime
 * 
 */
public class WebServiceTest {

	public static void main(String[] args) throws EASBizException, BOSException, SQLException {
		// test();
		// if(1==1){
		// return;
		// }
		XbangServiceInfo serviceInfo = new XbangServiceInfo();
		serviceInfo.dateCenterNumber = "001";
		serviceInfo.dbType = 2;
		serviceInfo.easSolutionName = "eas";
		serviceInfo.language = "l2";
		serviceInfo.operationName = "invoke";
		serviceInfo.serverIPAddress = "192.168.63.60";
		serviceInfo.serverPort = "6888";
		serviceInfo.userName = "user";
		serviceInfo.userPwd = "";
		serviceInfo.setArgs(new Object[] { "getTemplateTypeIDs"});
		try {
			 WebServiceClient client = new WebServiceClient();
			 client.login(serviceInfo);
			 System.out.println(client.callMethod(serviceInfo));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void test() {
		StringBuffer sql1 = new StringBuffer();

		sql1.append(" SELECT DISTINCT td.FOrgBoundID                             \n");
		sql1.append(" FROM T_CSL_TempletDispense td                              \n");
		sql1.append(" INNER JOIN T_ORG_TREE tree                                 \n");
		sql1.append(" ON tree.FID = td.FOrgBoundID and tree.FStatus <> 0      \n");
		sql1.append(" INNER JOIN T_RPT_Template t                                \n");
		sql1.append("    ON td.FDispenseSrcID = t.FID                            \n");
		sql1.append(" INNER JOIN T_RPT_Template t2                               \n");
		sql1.append("    ON t.FGroup = t2.FGroup                                 \n");
		sql1.append(" INNER JOIN T_CSL_CslReport r                               \n");
		sql1.append("    ON t2.FID = r.FTemplateID                               \n");
		sql1.append(" WHERE t2.FID = ?                                            \n");
		sql1.append(" And r.FID = ?                                            \n");
		sql1.append(" AND r.FReportDate >= tree.FStartDate                       \n");
		sql1.append(" AND r.FOrgUnitID = td.FCompanyID                       \n");
		sql1.append(" AND ((tree.FEndDate IS NOT NULL AND r.FReportDate <= tree.FEndDate) OR tree.FEndDate IS NULL)");
		System.out.println(sql1);
	}

}
